package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.BOPB227;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class BOPB227Converter implements AttributeConverter<BOPB227, String> {
    @Override
    public String convertToDatabaseColumn(BOPB227 bopb227) {
        return JSONUtil.toJsonStr(bopb227);
    }

    @Override
    public BOPB227 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, BOPB227.class);
    }
}
